package net.jjjshop.common.service.lbt.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.jjjshop.common.entity.lbt.JybBusinessOrderEntity;
import net.jjjshop.common.entity.lbt.JybBusinessOrderRequest;
import net.jjjshop.common.entity.lbt.LbLineUp;
import net.jjjshop.common.mapper.lbt.JybBusinessOrderMapper;
import net.jjjshop.common.service.lbt.JybBusinessOrderService;
import net.jjjshop.common.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 挂卖回收金币订单表 接口实现类
 * +----------------------------------------------------------------------
 * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 * +----------------------------------------------------------------------
 * @author: 大粽子
 * +----------------------------------------------------------------------
 * @date Tue Apr 16 01:19:29 CST 2024
 * +----------------------------------------------------------------------
 * @email stivepeim@outlook.com
 * +----------------------------------------------------------------------
 */

@Service("jybBusinessOrderService")
public class JybBusinessOrderServiceImpl extends ServiceImpl<JybBusinessOrderMapper, JybBusinessOrderEntity> implements JybBusinessOrderService {
    @Autowired
    private JybBusinessOrderMapper dao;
    @Autowired
    private UserService userService;
    /**
     * JybBusinessOrder列表查询
     * @param request 默认是是体类 根据自己需求修改或者创建自己的request
     * @return
     */
    @Override
    public IPage<JybBusinessOrderEntity> getList(JybBusinessOrderRequest request, Integer page, Integer limit) {
//        Integer UserId = userService.getUserIdException();
        Page<JybBusinessOrderEntity> pageUser = new Page<JybBusinessOrderEntity>(page, limit);
//        LambdaQueryWrapper<JybBusinessOrderEntity> lqw = Wrappers.lambdaQuery();
//
//        lqw.orderByDesc(JybBusinessOrderEntity::getCreateTime);

       Integer type = request.getType();
       Integer status =  request.getStatus();
       Integer uid =  request.getUid();
       Integer numType =  request.getNumType();
       Integer classType =  request.getClassType();

        IPage<JybBusinessOrderEntity> entityIPage = dao.selectData(pageUser,type,status, uid,numType,classType);

        return entityIPage;
    }

    @Override
    public IPage<JybBusinessOrderEntity> getSaleList(JybBusinessOrderEntity request, Integer page, Integer limit) {
        Page<JybBusinessOrderEntity> pageUser = new Page<JybBusinessOrderEntity>(page, limit);
        return null;
    }

}
